package org.example.struct.array;

/**
 * @author liyishan
 * @date 2024/5/10 10:14
 * @apiNote
 */

public class Test02960CountTestedDevices {
    public int countTestedDevices(int[] batteryPercentages) {
        int cnt = 0;
        for(int i = 0; i < batteryPercentages.length; i++){
            if(batteryPercentages[i] >0){
                cnt++;
                for(int j = i+1;j<batteryPercentages.length;j++){
                    if(batteryPercentages[j] > 0){
                        batteryPercentages[j]--;
                    }
                }
            }
        }
        return cnt;
    }
}
